﻿<html>
<head>
<style>
th{
	font-size:12px;
}
td{
	font-size:12px;
}
</style>
</head>
<body>
<?php
@ $matchId = $_GET["matchId"];

if ($matchId == NULL) {
	return;
}

$config = require 'conf/config.ini.php';      //加载公用config.ini.php
$conn = mysql_connect($config["DB_HOST"], $config["DB_USER"], $config["DB_PWD"]);
mysql_select_db($config["DB_NAME"], $conn);
mysql_query("SET NAMES utf8");

$sql = "select u.id userId,  u.userId userName, r.reviewText, r.updateDate ";
$sql .= "from live_review r, live_user u ";
$sql .= "where";
$sql .= "		r.reviewUser = u.userId ";
$sql .= "and	r.matchId = '" . $matchId . "' ";
$sql .= "order by r.updateDate desc";
$reviewList = mysql_query($sql, $conn);
?>
<table width="100%" cellspacing="0" cellpadding="2">
	<tr>
		<th>用户ID</th>
		<th>用户名</th>
		<th>评论内容</th>
	  	<th>评论时间</th>
	</tr>
<?php

$matchIdTemp = null;
$color = "";
$i = 0;
while ($review = mysql_fetch_object($reviewList)) {

		if ($i++ % 2 == 0) {
			$color = "#B5E7FF";
		} else {
			$color = "#FFFFFF";
		}

		echo '<tr align="center" bgcolor="' . $color . '">';
		echo '<td>' . $review->userId . '</td>';
		echo '<td>' . $review->userName . '</td>';
		echo '<td>' . $review->reviewText . '</td>';
		echo '<td>' . $review->updateDate . '</td>';
		echo '</tr>';
}
?>
</table>
</body>
</html>